Fixed a segfault with deep queries. Also made greater than operator work in deep queries.