Fixed some of the bugs with the initial multitasking implementation.