First attempt at #285
Merge pull request #1256 from shwei/patch-6

First attempt at #285