Fixes from MLB upstream

Bug: 56054
Bug: 56059
Change-Id: I549ba702c3b9bf9adec9fab692664eec1ff90005