Fix an IndexError