Fixes compilation with mono-2.2 natively plus a bunch of small bugfixes.
x86 stable
amd64 stable
ppc stable