Windows compile fixes, compiler warning fix, unfreed memory fix in main.c (though it would not have mattered since program exits immediately after).