Fix usage of document range setEnd.