Fixed bugs in the daemon version