Fix up some bugs with transforming