Fixing bug on how to detect that a agent is flawed