minor bug fixes to prevent crashing when no results are found