Remove chdir changes for now. Needs more testing.