Fixes #1007