Fixed weird overflow bug