Fixed removeRange() implementation