Fixed bug, where the task scheduler return errorcode=0, eventhough a task had failed.