fixed some bugs with surfaceC and rayC that somehow arose