Added more daemon tests. Fixed minor issues.

All 149 tests pass.