Fixes #1001