Tweaked parser to support halting