Fix debug logging in some (weird) cases.