Fix crash due to non-positive being produced sometimes.