Some fixes.

Some fixes to custom search, search and submit.