Fixed fatal bug (coding error really) or two in the task system