Fixes #585