Fixed compilation bugs