Fix bugs for no catch std::out_of_range exceptions.