Unify retry logic. Fix up specs.