Merge pull request #7 from mikey/master

Fixes for issues #5 and #6