[z1967] Backport misc changes from master

(cleaned version of 71c8e88)

(based on commit [s1556] - d351600)