fix selector bug and add tests
Merge branch 'RAM-fix-ast-selector-transformer' into develop