Fix #103. Queries are executed in their own transaction when available, but without using globals
Merge changes