Fix building with Mono on OS X
Fix broken tests on OS X