Fixed some bugs in inertial calculations