overflow bug fixes