Fixes #1246