Why does terrain set number destroy my bitmask?

v4.2.2.stable.official [15073afe3]

I have terrain set 0, terrain set 1 and terrain set 2 and sometime it makes swiss cheese out of my bitmask? I have redone the bitmask part a million times by now and still don’t know what’s causing it, it seems to be related to terrain set numbers, because bitmask got erased everywhere , where a number is. (Zero part was swiss cheese too but I have it repaired)