Fix crashing in transform