Fixes #1017