Implemented initial Daemon tests and fixes.