Cleaned up returned results format for sql queries.