Fixing the setup order of the scratch buffer