Tested exception in Matrix and main