Fixes #1006