Fix on_unload for 'log' script