1. Improve index performance.
2. convert unsigned long to uint32_t explicitly.