Revided the fix for #16, moving the allowSleepAgain call to the timer-stopped event listener