Changes for compiling on linux/Mac (incomplete)