fixed compilation errors by case, align types