Fix duplicate search form (Bug #13528).
Fix query if __owner is not mapped.
BFN