Fix potential crashes

https://github.com/GarageGames/Torque3D/pull/547
Minor cleanups

https://github.com/GarageGames/Torque3D/pull/546