Fixing issue with elevation calculation.