Added retry logic.

Fixes #40 
`options.retries--;` seems slightly more readable.