updated tests for matrix.add to check for thrown exceptions