Issue 3

Fix for issue 3, single commit on top of previous pull request.