Fix undef
Refine data coding handling
Clients MUST provide flash as boolean