Fixed various scheduling bugs and confirmed that it works