Fix trajectory exportation in joint-problem.cc