Fix cursor position and patch application (wrong hash method)