Fix min/max bug on windows