Merge release4.0 into dev

This PR merges release/4.0 into dev.