Clean up the trajclust function.