Bug fixes to make the calculation work