Fixed a bunch of hooks in PHP