Fixed 2 different crashes on deleting objects and a possible one on closing windows.
Fixed 2 different crashes on deleting objects and a possible one on closing windows.

gamefreak/Athena,gamefreak/Athena,gamefreak/Athena