Test case for closed type families

Also found bugs while writing test cases.