Merge "Fix NPEs after merge of d159ec534823b87f9896843e95912b0df8c27e16 from open source master."