More fixes for #141
Merge pull request #157 from objcow/master

Fix for #141