Fix class checking in agent
-