First pass at #72
Merge pull request #1249 from shwei/patch-2

First pass at #72