Fixed exiting on Android.