Fix TypeError: Range.prototype is undefined