Some miscellaneous fixes
Added support for $lang parameter for localization