Added handling for no near results and errors.