Genotype.encode() method tested and fixed