Fixes from last upstream merge.