a few small bug fixes
Merge pull request #174 from rtdog/master

a few small bug fixes