Some minor fixes to calculations that were incorrect