Fix #22
added test for Trajectories wirting