Fix for rev. 221024 and 221027
Merge pull request #894 from Vsevolod-Livinskij/fix_221024

Fix for rev. 221024 and 221027