fixes #1246