Fix notice about uninitialized index