Added unit tests to provide insight into a new issue as well as to better cover the code