Add test for integer ops and masks. Fix inverted masks.