Fix clearUnusedBits to not depend on "undefined behavior" of >> operator