Changing mask_type to dynamic_bitset (work on #721)