Added method removeIndexFromLastElement to DataPath