Set the proper class version when synthetic attributes or templates are detected.