Properly check empty lookup result