Change API matrix.item to matrix.get/matrix.set.