Fixed some problems in setTask