Minor improvement to numerical stability.