Fixed bug where registers weren't restored if scheduler was unable to run.