Fixed a bug with the last component index of a partitioning key