Fixes #100, backmerged to 1.9.0 branch.