Tweaks to parser for corner cases.