iptools: add docstring, minor changes