added windows fixes to sample_main