The issue was caused by lack of proper accumulation for averaging. Doing it incrementally introduced a bias.