Association error with types and subtypes