 			if (nestedStackPos == stackpos) {
 				nestedStackPos = -1;
 				isNested = false;
+				transformedRay = r;
 			}
 
 			node = *(--stack);

				}
			}
			else {
				traverseLeft = left->bbox.hit(isNested ? transformedRay : r, t_min, t_max);
			}
		}
		if (right) {

				const auto* rightobj = &ctxt->shapes[right->shapeid];

				if (right->nestid >= 0) {
					traverseRight = right->bbox.hit(transformedRay, t_min, t_max, &right_t);

					if (traverseRight && right_t < left_t) {
						right = &ctxt->nodes[right->nestid];
						nestedStackPos = isNested ? nestedStackPos : stackpos;;
					}
				}
				else {
