Fix a long standing bug whis history merging