Fix strip()

! Correctly strip spaces at the end of the line (especially important
  for \r\n)