Fix indexing problem with heterogeneous tuple