Increment a flow.get

I have had a strange issue, which I don't understand, I have the following in a function node

flow.set('count',flow.get('count')+1);

normally it works fine like flow.set('count') = 1 then 2 then 3 etc however for some unknown reason it started producing 34111111111111111 clearly its inserting 1's on the end of 34 not adding 1 to 34 I haven't reproduced this yet, but does anyone have an idea what circumstance would cause this ?

if somewhere else you have set it to be a string rather than a number

Use parseInt()

Yes,,, I found it, I send the number/result to a file and I can see in the file its a number, if node red is reset it gets the file contents
if(msg.filename=="datalog/count"){
flow.set('count',msg.payload);
}
but that returns a string (don't know why but I can fix it , thanks for the heads up you saved me a bunch of time trying to track this issue down.)
msg : Object
{ _msgid: "f4ebcfa.f7a9b3", topic: "", payload: "1242", filename: "datalog/count" }

and yes parseInt

if(msg.filename=="datalog/usage"){
msg.payload=parseInt(msg.payload);
return msg;
}