updated the test for malformed matrices to require excepting on empty matrices