BS-10779 Fix defect on refactor
- Apply patch from Aurelien
- Complete test to cover case of refactor references in aa operation's
leftOperand