I figured out the problem this morning. The variable cSigFile was always populated with the file name. I adjusted the code to only create the file (and set the variable) when the passed SigId was not zero.
A bit ashamed I could not figure this out last night. Today I woke up, thought a bit and it dawned on me.
If it's not broken, fix it until it is.
My Blog