Fix potential problem checking sum(prior)==1