Fixed DTW bug