Fix bug with negative values