Fix compiler warnings on Mono

Fix references for Mono

fix Rakefile to compile on Mono