patch by hand: binch made many changes

Signed-off-by: root <root@i-uvz6fz9d.(none)>