Fixes #1039