fixed search-replace patching and object shrinking