Fix debug logging