Misc fixes

Several small updates to allow compilation with mono V3.2