catch situations where nil would cause array index exceptions
Merge pull request #89 from eahrold/master

catch situations where nil would cause array index exceptions