Fixed bugs in getDynamics and getGP functions