Fixed windows API defining max() macro and screwing up all function calls to it (including numeric_limits<T>::max()