Protect min max in case of nil value.