Fix traceback when logging binary message length