merge parser and query fixes from rwhaling