Fix retraction issues after refactoring.