Changes min to prevent negative values