Fixed inequality in queries (as expected). Also cleaned up queries. #196