Remove an used variable.
Fix a couple of logging problems