Fix logic bug for reexec