Removed variable redeclaration to compy with new G++ standards.
Fixed pedantic warnings for C++2011 compliance.