Fixed another bug in calculation engine