Add pack index test.

Pack-index tests.
Bug fixes.