Fixed: search(v, 0) and added tests
Fixed: one-off bug in highest bit calculation