Fix a but in patchHunk that cause  to crash