Fixed small bug in removeRange() where i was being used rather than index