Fix for $field_cast fallback in query_field()