Fixing IP address sorting

Hi!

I've done some changes in your scripts to have the output well ordered by IP address.

Thanks