Added shapeValidatorWithDeriv