Fixing tests and adding log4j