Fixed daemon module and added test.