Fixed fault in indexing which caused wrong results