fix data check in generated code. move memset to fr_read functions