Fixed overflow bug caused by last commit.