Fixed several timer-related issues