Small bugfix and some code simplification in search.php.