Improvements to several queries.
Add query for non-settled transactions