Adding the patches to allow gcc 4.6.2 to build