An obvious mistake on my side. getFilePos returns an int64 that i try to put in an int-variable.
The error ocurred in old unremoved function but is also present in the new replacement. Apparently ive been blind to this. Wonder why it compiles at my side though. Is the compiler sometimes lenient in type matching int vs. int64? You dont have to file the issue anymore because it is getting (kind of) clear...