Implemented fix for CMemory that Brent discovered. Removed unnecessary patches.