Fix dim calculation of a R list object when writing a cell array
Added support to write a sparse logical matrix (lgCMatrix)