Updating lots of code, and fixing hook scripts