Fix max frequency to be max number, not max word