Fix debug formatting for string query results

Closes #720