Fixed bugs in GeneralizedCCD and SpherePrimitive