Fixing logging and some more of my code.