Fixed some overflow bug.