fixed error handling for int conversions.