Handle non-lowercase; rewrite as ugly Python hack instead of ugly C-in-Python hack.