Line ending correction