Fixed bugs that prevented pre-emption from working properly.