fixes problems with reading matrix and vector data