Obvious fix is obvious: some undefined indexes

Signed-off-by: emanuele <emanuele45@gmail.com>