Fixes #1791