Hooks fixes and additions.

Fixed errors related to Hooks.
Added some of the built-in hooks.