Fixes #538

I'm pretty sure this is the correct place to fix it, but please let me know otherwise.