Improve hooks documentation and debug output, fix few issues