Fixed randomly failing diff calculation