Corrected bug on bitest mask

- the code was using a wrong method to resize the mask
- corrected test executable
- corrected builder

- still present a bug in rule activation