Backported #85 in 2.1 branch

In response to #85.