ropes: Fix a bug in `RopeBuffer.clear`

… and clean `RopeBuffer` a little bit.