First pass at #337
Merge pull request #911 from anmonteiro/patch-2

First pass at #337