Fixed crashes when trying close emulator, yey!