In some cases, I get my log flooded with this message:
Notice: Undefined index: #type in template_preprocess_search_theme_form() (line 1109 of /var/www/www.unleashingideas.org/modules/search/search.module).
Solution should be pretty straightforward, just to check whether the index is present or not.