Fix a bug of getting peer address.