Fixes #1011