Fix autoshrink implementation