fix a few minor bugs and save language metadata into module