Added flexibility arguments to several trajectory functions.