Fix for when container and list entry have different namespaces.

I certainly came across the case when the list entry is part of a common namespace, but is being included in an entry belonging to a specific namespace.
This fix works for me, but I am not really familiar with the project, so may need rewriting for general usage.