Calculation fixes

Calculation fixes