minor changes to prevent occasional errors during traj scans
Chris's tidy up