patches: fix minor bugs