#305376, #303999 Change method of clearing theme registry to avoid errors other themes during update.php, patch by chrisearle.