Fix trailing # not being removed from filename.