Corrected failure case management and corrected related bugs
Added TaskFail to test said failure cases.