Correcting the code, so it works correctly for a small invertible matrix.