Fixed infinite loop issue with TransformToVisual.