Fixed for VS2013

cause error at min()