Corrects chance of NPE in UserAgentIdentService and updates unit test accordingly.