Small change to make it compile on linux, plus other changes