added log4j support and minor fixes