Normalize profiles before merging them

Fixes  #924