Updated again, fixed a bug.

In TDI forms: there are two ways of making a tab/form not closable:
1 - Set the ControlBox property of the Form to False.
2 - Set the ShowTabCloseButton parameter in the TDIBeforeNewTab event to False.

The recent fix was for the second option.