Code changes as suggested in #4238