Added type checking on collection extension