Avoid NPE in the caller.
Refactored to support changes in the contact between Java connector codebase and Python CLI.