I figured out a hack although I don't know if it is a the best solution or not but it works.
In advanced_search_results.php replace this
header('location: ' . tep_href_link( FILENAME_ADVANCED_SEARCH_RESULT , 'search_in_keywords=1&plural=1&s=1&keywords=' . urlencode($pwstr_replace) . '' ));
with
$urlll = tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT , 'search_in_keywords=1&plural=1&s=1&keywords=' . urlencode($pwstr_replace) . '' );
$urlll = preg_replace('/&/','&',$urlll);
header('location: ' . $urlll);