Fix corner-case casing issue

Fixes #510
Thanks @visemet!