Fix for #112

Hopefully replacement pull request for @mtravis's #122, which is not
against master
Merge pull request #123 from tomchadwin/master

Fix for #112