fixes to TSP