fix method_exist optimizer, pass parameters by reference in internal methods