Fixed compilation errors and set up the engine structure