Avoid undefined index errors.
Merge pull request #1 from mrubinsk/undefined_index

Avoid undefined index errors.