Merge pull request #352 from peternewman/trivial-fixes

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