Fixed small overflow bug