Fixing bug in transformation stack