Better construction of last_path