Correctly detect and log remote addresses.