Fix logic precedence bug, improve unexpected line format error message.