Fix bug #808 Problems after clearing catalog search + more bug fixes

Fix
- #808 Problems after clearing catalog search
- #818 In catalogue the search does not work when there are not subprotocols.
- #857 Catalog search exception