Fix #6487 (ambiguity warnings)