fix some bugs for calc module