Add missing .encode() for patch message