Use trim_path() instead of custom sed stanza to trim /:es from paths.