Fixes fips regression from #4068
Merge pull request #4093 from yurydelendik/issue4068

Fixes fips regression from #4068
Fixes but 960409 and adresses review comments including removal of do-while construct