Clean up broken pivot table functionality