bug fix in matrix-equal