Fixed issue #5 and added test for the functionality