Undefined index fix

Obviously if we try to pass non-array value, it will result in undefined index notice.
Merge pull request #698 from rozwell/patch-1

Undefined index fix
Merge remote branch 'upstream/master'