fix bitwise ops and mask support
Merge pull request #2455 from ilya-lavrenov:tapi_fix