Make code more compatible with upstream collectd