This does not work since in this function does the following
if(json.flag) flag = json.flag;
now if you set the value in the json string as "flag":false
this line reulst in not setting flag to false since json.flag is set to be false!!!
In the next version of EJS this should be rewritten to
if(! (json.flag===null) ) flag = json.flag;
I now have written my own unserialize function for flags which you can put in you custom function which you should call before calling the _model._userUnserialize or model unserialize function in your javascript