Fixed a number of bugs in IP address management