Fix row ordering