Minor edits

Improved query formatting. Handled exception for queries which return no values.