fix ambiguity warnings
Merge pull request #6832 from simonbyrne/triangular

fix ambiguity warnings