Fix matrix conventions