Fix index lookup