Language auto detection, bug fixed