Prevent "Syntax error, unrecognized expression: :nth-child"

When current index is 'undefined', use 0 and don't send 'NaN' to jQuery.
Merge pull request #57 from jamm/patch-1

Prevent "Syntax error, unrecognized expression: :nth-child"