Fix line rewrite issue on initial start