Fix Trac #2334: validity checking for type families