fix bitwise ops and mask support