Fix some overzealous regexes and make flake8 shut up.