fixes for predominant_category script