Fixed a bug in menv_update.