Fixed a small bug

Fixed a small bug that occurred due to the incorrect order of
transformations being applied. Corrected it now.