Fixed pushd and popd and corrected 3 unit tests