Adding a little debugging and fixing up_hook