fixes to ip handling