Fixed NPE if no stream for logging was provided