Do not use env->halted to decide where halted state should be handled