Fixes #521

This should fix #521