Mask out unused leftmost bits when checking for next clear bit