Fixes #1312