Pathtracing final

Pathtracing completely fixed, seems to work in all cases now.