Fixes invert sorting of lines