fixed errant JS errors and included hooks.js in precompilation