Fix restoring HOME, etc.