Changed code so it can be ran on other systems using Mono.