Correction and Planning with Memory Integration