fix case indetification in linear transformation revert

The if forgot to check for squareness of matrix