Fixed incorrectly-placed popd statement