Trim after removing line ends