Backport compatible changes from TP2.3 branch to master