Fix hooks on Windows