Cleaning up buffer resets and removing immediate writes.