Handle edge cases for transpose and be forgiving