Fixed code so it compiles and run on Linux