Fix range error in addFormat if start == end container.