fix zval allocation