Fixing row col swaps in code