startup/exit fixes on iOS