A bit of javascript fixing