Fix potential KeyError in schedule.delete and more unit tests
Reformat changes to schedule.reload