Fixes #1018