Fix query splitting expression