[Contacts] Fix listener logical bugs and codingstyle.