Imported fixes from branch 1.14