Patch.php permissions corrections