Bugfixing invalid locale detection