Fix rawsql bug