fixed mangle bug and language guessing on .tr