Add a logger, correct typos and prepare for daemonization