Got rid of some unnecessary code when checking for the right type of resource agent.