Fixed #1087 in maintenance branch.