Changed ordering of the declarations in the header to make compatible with VS 2012. Also fixed a small issue that caused a 'use of uninitialized variable' error in VS 2012.