fix typo in internal calculations