Fix range validation when min and max are setted