Same fix as for 1f9812ab83 Not sure if this code actually does anything though, `buffer_max_used` seems unused.
1f9812ab83