Fix bug in q string parsing