Cross-browser compatibility fix

Ranges used to ruin everything