eterm::encode bug fix (rather workaround)