cmd_util: fix run_hooks