First try at #378
Merge pull request #878 from eschaefer/master

First try at #378