Minor performance improvements to contact fetching.