Make Q to be string. Improve related API.