Fixed infinite loop in task manager service.