Fix deprecated has_cap() issue.