Fix bug DNN-22725: apply fix from Jira.