Fixed bugs and added logs to the daemon plugin.