Add test for matrix class + cleanup