Fix a regression where undefined id should not match any record