Fixes #581