Fixes for gravity vector calculations.