state allocation fix; ext encoding size fix