Very rough hack to make everything compile and run under vs2013.