Fixed bias problem due to various alphabet size. thx @brinchj