Refactors and fixes fb1d115262 regression.
Merge pull request #1776 from yurydelendik/avm1stage

Refactors and fixes fb1d115262 regression.