Delete unused variables
Modified for VS2012 compiler

Clean-up some warning messages.