correct the length of the encoding vector (thanks to GLI for the report of this problem)