Strip \n correctly, fixes #4