Fix list indexing