diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/ComponentFactory.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/ComponentFactory.java
index dbd73f2..8be6408 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/ComponentFactory.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/ComponentFactory.java
@@ -200,8 +200,10 @@
      * Stop all the instance managers.
      */
     public synchronized void stopping() {
-        m_tracker.close();
-        m_tracker = null;
+        if (m_tracker != null) {
+            m_tracker.close();
+            m_tracker = null;
+        }
         m_classLoader = null;
         m_clazz = null;
     }
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/context/ServiceReferenceImpl.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/context/ServiceReferenceImpl.java
index 7bdb382..5a57c83 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/context/ServiceReferenceImpl.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/context/ServiceReferenceImpl.java
@@ -18,6 +18,8 @@
  */
 package org.apache.felix.ipojo.context;
 
+import java.util.Dictionary;
+
 import org.apache.felix.ipojo.ComponentInstance;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.ServiceReference;
@@ -87,6 +89,10 @@
     public String[] getPropertyKeys() {
         return m_registration.getPropertyKeys();
     }
+    
+    public Dictionary getProperties() {
+        return m_registration.getProperties();
+    }
 
 
     /**
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/context/ServiceRegistrationImpl.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/context/ServiceRegistrationImpl.java
index 9cd8edf..0dc8dfb 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/context/ServiceRegistrationImpl.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/context/ServiceRegistrationImpl.java
@@ -24,6 +24,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 
 import org.apache.felix.ipojo.ComponentInstance;
 import org.apache.felix.ipojo.InstanceManager;
@@ -155,7 +156,6 @@
 
     /**
      * Look for a property in the service properties.
-     * 
      * @param key : property key
      * @return the object associated with the key or null if the key is not
      * present.
@@ -179,6 +179,22 @@
             return (String[]) m_list.toArray(new String[m_list.size()]);
         }
     }
+    
+    /**
+     * Gets the published properties.
+     * @return the dictionary containing each published properties.
+     */
+    protected Dictionary getProperties() {
+        synchronized (m_propMap) {
+            Dictionary dict = new Properties();
+            Iterator keys = m_propMap.keySet().iterator();
+            while (keys.hasNext()) {
+                String key = (String) keys.next();
+                dict.put(key, m_propMap.get(key));
+            }
+            return dict;
+        }
+    }
 
     /**
      * Get the service object.
@@ -196,7 +212,6 @@
 
     /**
      * Initialize properties.
-     * 
      * @param dict : service properties to publish.
      */
     private void initializeProperties(Dictionary dict) {
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/context/ServiceRegistry.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/context/ServiceRegistry.java
index 6eb3d7e..3eaebdd 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/context/ServiceRegistry.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/context/ServiceRegistry.java
@@ -177,7 +177,8 @@
                 if (info.m_filter == null) {
                     info.m_listener.serviceChanged(event);
                 }
-                if (info.m_filter != null && info.m_filter.match(ref)) {
+                Dictionary props = ((ServiceReferenceImpl) ref).getProperties();
+                if (info.m_filter != null && info.m_filter.match(props)) {
                     info.m_listener.serviceChanged(event);
                 }
             }
@@ -210,15 +211,16 @@
                 boolean matched = false;
 
                 // If className is null, then look at filter only.
-                if ((className == null) && ((filter == null) || filter.match(reg.getReference()))) {
+                if ((className == null) && ((filter == null) || filter.match(reg.getProperties()))) {
                     matched = true;
                 } else if (className != null) {
                     // If className is not null, then first match the
                     // objectClass property before looking at the
                     // filter.
-                    String[] objectClass = (String[]) ((ServiceRegistrationImpl) reg).getProperty(Constants.OBJECTCLASS);
+                    Dictionary props = ((ServiceRegistrationImpl) reg).getProperties();
+                    String[] objectClass = (String[]) props.get(Constants.OBJECTCLASS);
                     for (int classIdx = 0; classIdx < objectClass.length; classIdx++) {
-                        if (objectClass[classIdx].equals(className) && ((filter == null) || filter.match(reg.getReference()))) {
+                        if (objectClass[classIdx].equals(className) && ((filter == null) || filter.match(props))) {
                             matched = true;
                             break;
                         }
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandler.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandler.java
index 1fc3e1d..fad5a30 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandler.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandler.java
@@ -506,7 +506,7 @@
             try {
                 all = computeInterfaces(serviceSpecification, parent, desc.getBundleContext().getBundle());
             } catch (ClassNotFoundException e) {
-                throw new ConfigurationException("A interface cannot be loaded : " + e.getMessage());
+                throw new ConfigurationException("An interface cannot be loaded : " + e.getMessage());
             }
             
             String serviceSpecificationStr = provides[i].getAttribute("interface");
@@ -540,7 +540,6 @@
             }
             
             specs.append('}');
-            
             provides[i].addAttribute(new Attribute("interface", specs.toString())); // Add interface attribute to avoid checking in the configure method
 
             Element[] props = provides[i].getElements("property");
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/ManifestMetadataParser.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/ManifestMetadataParser.java
index ea0709e..833be9c 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/ManifestMetadataParser.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/ManifestMetadataParser.java
@@ -210,6 +210,22 @@
         }
         return parser.m_elements[0];
     }
+    
+    /**
+     * Parse the metadata from the given header string.
+     * @param header : the header to parse
+     * @return Element : the root element resulting of the parsing
+     * @throws ParseException : if any error occurs
+     */
+    public static Element parseHeaderMetadata(String header) throws ParseException {
+        ManifestMetadataParser parser = new ManifestMetadataParser();
+        parser.addElement(new Element("iPOJO", ""));
+        parser.parseElements(header);
+        if (parser.m_elements.length != 1) {
+            throw new ParseException("Error in parsing, root element not found : " + header);
+        }
+        return parser.m_elements[0];
+    }
 
     /**
      * Parse the given string.
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/ParseUtils.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/ParseUtils.java
index e1597a3..e8d5bba 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/ParseUtils.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/ParseUtils.java
@@ -36,6 +36,10 @@
      * @return the resulting string array
      */
     public static String[] parseArrays(String str) {
+        if (str.length() == 0) {
+            return new String[0];
+        }
+        
         // Remove { and }
         if (str.charAt(0) == '{' && str.charAt(str.length() - 1) == '}') {
             String internal = (str.substring(1, str.length() - 1)).trim();
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/util/DependencyModel.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/util/DependencyModel.java
index d644805..21b9b3a 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/util/DependencyModel.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/util/DependencyModel.java
@@ -24,6 +24,7 @@
 import java.util.List;
 
 import org.apache.felix.ipojo.ConfigurationException;
+import org.apache.felix.ipojo.context.ServiceReferenceImpl;
 import org.apache.felix.ipojo.metadata.Element;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Filter;
@@ -240,11 +241,32 @@
      * @see org.apache.felix.ipojo.util.TrackerCustomizer#addedService(org.osgi.framework.ServiceReference)
      */
     public void addedService(ServiceReference ref) {
-        if ((m_filter == null || m_filter.match(ref)) && match(ref)) {
+        if (matchAgainstFilter(ref) && match(ref)) {
             manageArrival(ref);
         }
         // Do not store the service if it doesn't match.
     }
+    
+    /**
+     * Check if the given service reference match the current filter.
+     * This method aims to avoid calling {@link Filter#match(ServiceReference)} 
+     * method when manipulating a composite reference. In fact, this method throws
+     * a {@link ClassCastException} on Equinox.
+     * @param ref : the service reference to check.
+     * @return true if the service reference matches.
+     */
+    private boolean matchAgainstFilter(ServiceReference ref) {
+        boolean match = true;
+        if (m_filter != null) {
+            if (ref instanceof ServiceReferenceImpl) {
+                // Can't use the match(ref) as it throw a class cast exception on Equinox.
+                match = m_filter.match(((ServiceReferenceImpl) ref).getProperties());
+            } else { // Non composite reference.
+                match = m_filter.match(ref);
+            }
+        }
+        return match;
+    }
 
     /**
      * Manage the arrival of a new service reference. The reference is valid and match the filter and the match method. This method has different
@@ -346,7 +368,7 @@
     public void modifiedService(ServiceReference ref, Object arg1) {
         if (m_matchingRefs.contains(ref)) {
             // It's a used service. Check if the service always match.
-            if (!(m_filter == null || m_filter.match(ref)) && match(ref)) {
+            if (!matchAgainstFilter(ref) && match(ref)) {
                 // The service does not match anymore. Call removedService.
                 manageDeparture(ref, arg1);
             } else {
@@ -354,7 +376,7 @@
             }
         } else {
             // The service was not used. Check if it matches.
-            if ((m_filter == null || m_filter.match(ref)) && match(ref)) {
+            if (matchAgainstFilter(ref) && match(ref)) {
                 manageArrival(ref);
             }
             // Else, the service does not match.
@@ -522,7 +544,7 @@
                     // Compute matching services.
                     List matching = new ArrayList();
                     for (int i = 0; i < refs.length; i++) {
-                        if (m_filter == null || m_filter.match(refs[i]) && match(refs[i])) {
+                        if (matchAgainstFilter(refs[i]) && match(refs[i])) {
                             matching.add(refs[i]);
                         }
                     }
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/util/Logger.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/util/Logger.java
index c8b8c26..0cde723 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/util/Logger.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/util/Logger.java
@@ -244,7 +244,8 @@
         
         // If null, look in bundle manifest
         if (level == null) {
-            level = (String) context.getBundle().getHeaders().get(IPOJO_LOG_LEVEL);
+            String key = IPOJO_LOG_LEVEL.replace('.', '-');
+            level = (String) context.getBundle().getHeaders().get(key);
         }
         
         if (level != null) {
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/util/Property.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/util/Property.java
index 3c11693..a36bf40 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/util/Property.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/util/Property.java
@@ -318,7 +318,9 @@
         if (Character.TYPE.equals(type)) { return new Character(strValue.charAt(0)); }
 
         // Array :
-        if (type.isArray()) { return createArrayObject(type.getComponentType(), ParseUtils.parseArrays(strValue)); }
+        if (type.isArray()) {
+            return createArrayObject(type.getComponentType(), ParseUtils.parseArrays(strValue)); 
+        }
         // Else it is a neither a primitive type neither a String -> create
         // the object by calling a constructor with a string in argument.
         try {
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/util/Tracker.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/util/Tracker.java
index 7dd3349..a4d3526 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/util/Tracker.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/util/Tracker.java
@@ -24,6 +24,7 @@
 import java.util.LinkedList;
 import java.util.List;
 
+import org.apache.felix.ipojo.context.ServiceReferenceImpl;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
 import org.osgi.framework.Filter;
@@ -607,8 +608,15 @@
             switch (event.getType()) {
                 case ServiceEvent.REGISTERED:
                 case ServiceEvent.MODIFIED:
-                    if (m_listenerFilter == null) { // user supplied filter 
-                        if (m_filter.match(reference)) {
+                    if (m_listenerFilter == null) { // user supplied filter
+                        boolean match = true;
+                        if (reference instanceof ServiceReferenceImpl) {
+                            // Can't use the match(ref) as it throw a class cast exception on Equinox.
+                            match = m_filter.match(((ServiceReferenceImpl) reference).getProperties());
+                        } else { // Non compute reference.
+                            match = m_filter.match(reference);
+                        }
+                        if (match) {
                             track(reference); // Arrival
                         } else {
                             untrack(reference); // Departure
