Fix possible undefined index

Signed-off-by: Norv <a.w.norv@gmail.com>
Merge pull request #189 from norv/fixes

Fix possible undefined index