Fix a timer bug that made the app crash.