fix reversed patches