Fix cross-device symlink bug.