Logging using log4j and small fix