Fixed subrange, DX error on exit and WinMain function