Solved by ptrblck in post #2 
              
              
                I guess the difference domes from the var calculation, which should apparently be unbiased. 
I’ve written a manual implementation some time ago here so feel free to compare your code to this one.