[z2022] Fix various warnings

(based on commit e36c668)

(cleaned version of 5a13ad1)

(based on commit [s1633] - ca0c0dc)