Fix more problems in logging before injecting