Added unit test for issue #58 and updated unit test for issue #23