Fixed minor bug when releasing hook.