Added support for gcc 4.6 to the build.
Fixed gcc 4.6 related compile errors.