Fixed various logging issues