Fix a logic issue in checking for addresses