Fix logging in mostly. It's still ugly.