Fixes to the intersection code. Basically working now, but still lacking internal surface.