Fix LSBMask function to actually create a mask of N least-significant bits.