Fixed patching errors