Fixed an issue with daemonization code: now ready for production