Fixed a bug in the Transform method