Second attempt at #92.
Merge pull request #804 from dsissitka/patch-2

Second attempt at #92.