Another pass at #339
Merge pull request #1153 from ericburns/patch-2

Another pass at #339