Fixes resolving to db_field from class field name, in distinct() query.