Fix to patch positions in output file