Fixed a math blunders in jjh_lib