Fix IndexError: invalid index to scalar variable
Merge pull request #313 from cgohlke/patch-1

Fix IndexError: invalid index to scalar variable