Pack IP addresses in Python and add some more debugging to the C++ code