Tweak the cleaning of inplace/; fixes trac #4320