Fixed a bunch of bugs to actually get the initial version of the tasking API working.