fixed incorrect setting the coding vector in the perpetual generator
adding tests