Improved foreach search.
Fixed injections not working across dynamic inheritance.