Fixed bug when uploading data to matrixBuffer