Fixes for my two issues
Merge pull request #5 from nickkitto/master

Fixes for my two issues - Thanks!  This looks safe so I'm merging it.