Fixes #1786