#3 Added an additional unit test and corrected errors exposed by it.