Cherry-picked fix for title wrap problem from layout_improvement
* cherry-picked from 92d1f4b