Avoid using pushd/popd as they are not always available