Fix hook order execution.

This fixes the order that hooks are executed when using the array syntax to register multiple hooks.