Fix #1644 by resetting the correct variable onPause.