Indexing bug in tuples