More DR unit tests and code cleanup