Fix the miscalculation of newline