Fixed a bug with kinetic energy