Fix buggy retry code. Issue #71