Fixed many bugs in transforms