fixed stupid windows.h minmax issues
fixed more potential min/max problems
AWG, fixes