Fix bug when copying demo query.