Do not use Node.remove method (broken in Firefox)
Replace window.Range constructor with document.createRange()
Fix missing arg for older versions of Firefox