Fixing debug logging