Prevent crashes wrong lineFeed input

There was case when length was greater than width,
or one of the values was NaN