Fixed logging issues