Fixed an exception when no results were returned.