Modified get_permalink to fix url for specifying language in the path.
Modified nL_detect_requested_language to handle path method properly for websites in a subdirectory.