add agentset type checking to link creation prims

fixes #338