Some test and logging fixes