Fix pivot table problem