Fixed overflow bug