Fixes #1936
Merge with 1.7