Fixed mono build errors

I spotted errors with Travis, pulled source to OSX and it didnt build.

These changes make it build on Mono