Fix rewriting of failed entries