use long long for countSetBitsUpTo() tests
isLeaf -> inLeaf