Fix issue where fieldnames wasn't being returned by _get_fieldnames