Fixes #1047