Improve numerical stability