Fix wrong CWD when processing hooks.