Fixed undefined index errors if no search results are found