Some tidying up, fix 'textContent' bug