Updates to JS mode hooks, minor fix to snippet