Improved test coverage and fixes issue #7.