fix error message when no type matches.