Fix for older pandas versions