Corrected handling when no results are returned