Fix various bugs, including a frightening one which seemed to derive from occasional mishandling of strings beginning with '\0' by V8 (truncated across function call boundaries?')