Fix logging bugs.