Fixes #1116.