Js hooks fixes

Refs #6499 and #6531.