Fixes #1002