fixed indexer, added index test cases