Fixed some logging issues