Fixed some logging bugs.