Small fixes to contact management