Fixed crash on exit & event handling. Added deltaTime