Fix notice when an index is undefined.