Fix common cwd segment for absolute paths