* Fixing off-by-one error in has_head_in_buffer
* Fix to min_upd