Fixed #12 (scheduler: Put magic verifications inside critical sections).