Fix incorrect order of operations in sleep-timer()