Added retry logic.

Fixes #40