Check for statSet length

As I don't know my way round the whole codebase, I've checked for a length greater than one as this covers both the error I was getting on line 623, and a possible(?) undefined value assigned on line 626.

closes #212
Merge pull request #213 from allouis/patch-1

Check for statSet length