Fix broken daemon mode, and improve thread names in the logs