Various fixes to the global illumination implementation.