Add unit tests to hash_candidates.

Fix style errors in sum_bits.