Do not chdir unless necessary