Regularise error throwing in staticNode.js (fixes #21)