Candidate fixes for merging to 2.5.x

Candidate fixes for merging to 2.5.x