When a Script ends due to an error I am getting two B4PEndOfProgram events raised if I have shown a Form

.
Also it would be nice for the B4PEndOfProgram event code to be able to know if the program ended without error or not, perhaps by a property in B4P.
Code:
AddForm("Form1")
Form1.Show
DoEvents ' allow Form to be shown
doh ' deliberate error causes two B4PEndOfProgram events
By the way, my Debugger library works fine as long as a Form is shown by the Script

.