Optimum merging -- more bug fixes