fix patching issues with dos mode