Fix compilation errors and possible server crash from previous commits.
Update HPM hooks after commit 6dd08befa6064a652d0d98e7cb85f0e353992dd5.
Merge pull request #424 from 4144/hpmupdate

Fixes after commit 6dd08befa6064a652d0d98e7cb85f0e353992dd5.