fix & apply patches