Switch: fixed handling of last buckets, optimized to use faster word cmp