Minor fixes for daemon mode