add more tests of querying pojos, and related fixes