Fix patch query