Generation of function pointers

+ 2 small changes for VC++ 2010/.NET 4 compatibility.