Logging implemented, fixes to other things.