Added unit tests to cover the duplication error and reduced some of the cruft throughout the other tests