Fixed an overflow bug