Fix bug with positive values having sign flipped