Apply correct mask for bitwise NOT