fixed some bugs in calculation behavior
fixed some bugs in calculation behavior