Applying changes suggested in pull-request #4438