Merge pull request #219 from timwindsor/master

Fixes from @anphorea