Patched scripts and supporting code