Fixed a crash in the raytracer