fix dumb bugs, make userscript work on headnode