Bug fixing on scripts/R/calculate_diversity.R