Fix precision issue in library