Windows build fixes; iterator bug fix