Fixed bug in ip handling.