Clean up codes in ComputeMaskedBits():