Added check for invalid QualifiedRefs that end with a ClassRef