Fix logging related NPEs
Add logback.xml file to classpath
Fix EOFException on closing the object stream. Wrong termination check corrected.