Fixed daemon mode

Also added a load more logging messages to make it obvious what's going
on in daemon mode