Fixed early ray termination.