Fix typeclass problems so that most of precategories compile, without too many changes