Fix patch scripts