Bug fix: index == 0 is also valid