Better error handling for contact matching.