Data correction on replaced codes