A few bug fixes
Merge pull request #35 from brentongunning/master

A few bug fixes