Fix autologging after history clearing