Fixes #100 from @1evan2
fixes #99 for @restless
Merge pull request #115 from maxcan/master

fixes #100 from @1evan2 and #99 from @restless