         {
             if (styleName is String)
             {
-                styleName =
-                    StyleManager.getStyleDeclaration("." + styleName);
+                chain = addStylesToProtoChain(String(styleName), chain, target);
             }
-
-            if (styleName is CSSStyleDeclaration)
+            else if (styleName is CSSStyleDeclaration)
+            {
                 chain = styleName.addStyleToProtoChain(chain, target);
+            }
         }
 
         chain = super.addStyleToProtoChain(chain, target);

            {
                if (headerStyleName is String)
                {
                    headerStyleName =
                        StyleManager.getStyleDeclaration("." + headerStyleName);
                }

                if (headerStyleName is CSSStyleDeclaration)
                    chain = headerStyleName.addStyleToProtoChain(chain, target);
            }
        }


            {
                if (headerStyleName is String)
                {
                    chain = addStylesToProtoChain(String(headerStyleName), chain, target);
                }
                else if (headerStyleName is CSSStyleDeclaration)
                {
                    chain = headerStyleName.addStyleToProtoChain(chain, target);
                }
            }

            headerStyleName = getStyle("headerStyleName");
