Fixed merging of max