Fix bug occuring when a buffer part gets partially shrunk