bugfix: ln 874 when components.size()==0 gets stuck in loop due to -1
Merge pull request #2 from xthepoet/patch-1

bugfix: ln 874 when components.size()==0 gets stuck in loop due to -1