Fixed bug with removing ranges