Fixed compilation error in functions