Fixed a mistake in line ordering