Fixed minor bug in trajectory