Fixed some of the compilation errors in the code