Fixes #1004