Generating the correct extend type for the agents (issue #49).