Fixed a bug with indexing of entities in terms of OFfsets