Fix weird language detection

Not sure how this ever worked, but I was able to get it working with this fix.