Fixes #1031