Fixed compilation errors of sleep