Let createAgent() return the specified class type. (Rick's request)