Fix TaskManager initialization