Bugfix for --daemon