Added a unit test and a few general changes