handle edge case where results.length is 0
Merge pull request #70 from waneka/bugfix_resultclass

handle edge case where results.length is 0