Fixed bug in range update