Add stolen functions from nikic/iter