Code changes for #4252