fixed range and int bugs