COMPAT: Fix for older versions of pandas.