Fixing more problems, improving logging output