Added some retries in order to avoid crashing with some particular
exceptions.