Make (c)transpose work correctly for block matrices