Fix saving raw queries (and chart queries too I guess).