Fixed errors with closing forms

Had to add "Application->Terminate" to Form1->onClose