Handle moving directories correctly.