[PATCH] clean up pack index handling a bit