Fixed bugs that may happen in the case of EV_ERROR