Improve selecting default contact and adds some NPE checks.