Modify codes due to compilation errors