Bugfix 40 memory leaks

No more leaks on windows.
Also suppressed some warnings on VC2012