Fix undefined array key notice

Fixes #1319