Fixed issues associated with finding the inverse of a matrix.