Fix bugs in calculation of frequency map in in 'convert2un'