Use basename instead of a cryptic sed.