Workarounds for bsrmap.aggregate_categories to address data and environment issues