Fix undefined array key notice

Fixes #1319
Merge pull request #1322 from jrfnl/Issue-1319

Fix undefined array key notice, props @jrfnl