Solve problems when exposing global. Fix also problems when extending templates and components.