fix min/max type