Added mainFirst option to callHooks.