Fixed some logging bugs