Fixed compilation errors and typos