allow querying on public entities, fixed some tests