fixed numerical instability in Kalman filter computations