Fixes #977