Fixed sorting bug.

Subdivision seems to be working now for a single ray