Initial version with small fix
Fix: popd on empty DIR_STACK