Fix queries on dicts with no keys

Also fix tests not running due to no encoding being specified.