Fix for issue #23
Merge pull request #25 from pgh70/bugfixes

Fix for issue #23