Auto daemonize and fix bug in clone