Fixed bug where 'closest node' could end up being 127.0.0.1.