Fixed wrong line ending detection