Fix cost computation