Fix onStop bugs.