Undefined index problem fixed, refs #1170.
Merge pull request #1201 from phaidon/undefined-index

Undefined index problem fixed, refs #1170.