Improve formatting of matrices.