Fixes #522