Correct compilation problems with Visual Studio compiler

This fixes issues when using the Visual Studio compiler. It doesn't allow for C99/C++ variable declarations after statements.