Fixing crash when rotating the main activity.
Fixing crash when stopping tracking time.