Bug 15115028 Also fixes NPE when there is shared element name mismatch. Change-Id: I8a65428d4b215ada532e98a555649c2e046de5ef