fixed certain issues with patching