Bugfix IP loop count

fixes #29