Improved indexer when dealing with inheriting entities.
Improved selecting root entity.
Fixed typo.
Merge pull request #5 from beregond/inheritance

Improved indexer when dealing with inheriting entities.