Simplify a few uses of remove_filename by using parent_path instead.