Maximum-likelihood methods in powder diffraction refinements