Added log statemnets and fixed minor bugs.

Addressed code review comments, added log statements to make sure only one instance of session and cluster is created per application and fixed minor bugs.