random patches

random things that seem to work on my machine, have to run now so will clean later just FYI
Sorry, white background and black foregroud. I had to look at the source of term.js to figure it out, and that's how the author do it.