Forward port '7.0' into 8.0 until 3d9552a

The conflict resolution commit is d563a3c9a30b7733703c19d37c46bd123534302e, best view in gitk.