Added tests before computing inverse matrix.