Correction of the recover method and add tests.